Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor sub_assign DensePolynomial #906

Closed
wants to merge 2 commits into from

Conversation

tcoratger
Copy link
Contributor

Description

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the GitHub PR explorer

@tcoratger tcoratger requested review from a team as code owners December 15, 2024 23:32
@tcoratger tcoratger requested review from Pratyush, weikengchen and tyshko-rostyslav and removed request for a team December 15, 2024 23:32
} else {
// Add the necessary number of zero coefficients.
self.coeffs.resize(other.coeffs.len(), F::zero());
self.coeffs = other.coeffs.iter().map(|&x| -x).collect();
Copy link
Member

@Pratyush Pratyush Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hope with the old way was that if self.coeffs has capacity large enough (e.g., it was the result of a previous operation that resulted in a zero), then we can avoid re-allocation via the collect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes you are right didn't notice that. Then there is no point to refactor this, this is already optimized, let us close :)

Co-authored-by: Pratyush Mishra <pratyush795@gmail.com>
@tcoratger tcoratger closed this Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants